<%
	/**
	 * js 的 date操作
	 * 
	 * created by amon
	 */
%>
<script>
	/**
	 * @ param: str java.sql.Timestamp yyyy-mm-dd hh:mm:ss 
	 *
	 */
	function timestamp2Date(str)
	{
		return new Date(Date.parse(str.replace(/\-/g, '/')));
	}

	/**
	 * 
	 * return 'yyyy-mm-dd hh:mm:ss'
	 */
	function date2Timestamp(date)
	{
		return (date.getYear())+ "-" + (date.getMonth() + 1) + "-" + (date.getDate()) + " " + (date.getHours()) + ":" + (date.getMinutes()) + ":" + (date.getSeconds());  
	}

	/**
	 * date + n 年
	 * 
	 */
	function addYear(date, year)
	{
		date.setYear(date.getYear() + year);
		return date;
	}


</script>
